home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 16
/
AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso
/
pd
/
anwendungen
/
amicad
/
arexx_english
/
selectparts.amicad
< prev
next >
Wrap
Text File
|
1998-06-01
|
2KB
|
64 lines
/* This script selects all the components with the same name
$VER: SelectParts.AmiCAD 1.02e (© R.Florac, 24 mai 1998) */
options results
signal on error /* error handling */
signal on syntax
'FIRSTSEL'; objet = result
if objet = 0 then do
'COMPOSANT=ASK("What''s the name of"+CHR(10)+"the searched component ?")'
part=result
if part="" then exit
end
else do
'COMPOSANT=PARTNAME('objet')'
part=result
if part="" then do
'TYPE('objet')'; type=result
'SECURITY(OBJECTS(-1)+10):FOR(I=1:N=0,I<=OBJECTS(-1),IF(TYPE(I)=='type',MARK(I):N=N+1,0),I=I+1)'
'N'; n=result
affichage(n,type)
exit
end
end
'SECURITY(OBJECTS(-1)+10):N=0:I=0:WHILE(I=IF(I+1<=OBJECTS(-1),FINDPART(I+1,COMPOSANT),0),MARK(I):N=N+1)'
'N'; n=result
affichage(n,1)
exit
affichage: procedure expose part
parse arg nombre, type
select
when type = 1 then element = part
when type = 2 then element = "wire"
when type = 3 then element = "arc"
when type = 4 then element = "text"
when type = 5 then element = "component reference"
when type = 6 then element = "component value"
when type = 7 then element = "junction"
when type = 8 then element = "dashed line"
when type = 9 then element = "bus"
when type = 10 then element = "ellipse"
when type = 11 then element = "input connector"
when type = 12 then element = "output connector"
when type = 15 then element = "double line"
when type = 21 then element = "other line"
when type = 22 then element = "box"
otherwise element = "élément"
end
'MESSAGE("Selected object type:"+CHR(10)+"'element'"+CHR(10)+"Found: 'nombre'")'
exit
end
syntax:
erreur=RC
'MESSAGE("Script SelectParts"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
exit
error:
'MESSAGE("Script SelectParts"+CHR(10)+"Error in line 'SIGL'")'
exit